<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('AdminCardType/index')}">礼券信息</a></li>
			<li><a href="{:url('AdminCardType/add')}">新增礼券</a></li>
			<li class="active"><a>编辑礼券</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('AdminCardType/editPost')}">
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required">*</span>名称
				</label>
				<div class="col-md-3 col-sm-10">
					<input type="text" class="form-control" name="name" value="{$card->name}">
				</div>
				<label class="col-sm-2 control-label">
					规格
				</label>
				<div class="col-md-3 col-sm-10">
					<input type="text" class="form-control" name="spk" value="{$card->spk}">
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label">
					图片
				</label>
				<div class="col-md-3 col-sm-10">
					<input type="hidden" name="img" id="cardimg" value="{$card->img}">
					<a href="javascript:uploadOneImage('图片上传','#cardimg');">
						<if condition="empty($card.img)">
							<img src="__TMPL__/public/assets/images/default-thumbnail.png" id="cardimg-preview" width="135" style="cursor: pointer" />
						<else/>
							<img src="{:cmf_get_image_preview_url($card->img)}" id="cardimg-preview" width="135" style="cursor: pointer" />
						</if>
					</a>
					<input type="button" class="btn btn-sm" 
						onclick="$('#cardimg-preview').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#cardimg').val('');return false;"
					 	value="取消图片">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">
					描述
				</label>
				<div class="col-md-8 col-sm-10">
					<textarea name="desc" class="form-control" rows="10">{$card->desc}</textarea>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<input type="hidden" name="id" value="{$card->id}" />
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
					<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>